'use strict'

module.exports = app => {
  const { router, controller, middleware } = app
  const authLogin = middleware.authLogin()

  router.get('/system/wxLogin', controller.user.login)
  router.get('/equipment/create', authLogin, controller.equipment.create)
  router.get('/equipment/query', controller.equipment.query)
  //更新设备名称
  router.get('/equipment/update', authLogin, controller.equipment.update)
  // 删除设备
  router.get('/equipment/delete', authLogin, controller.equipment.delete)
  router.post('/fence/create', authLogin, controller.fence.create)
  router.get('/fence/query', authLogin, controller.fence.query)
  router.get('/fence/update', authLogin, controller.fence.update)
  router.get('/fence/queryById', authLogin, controller.fence.queryById)
  // 用户设备列表
  router.get('/userDevice/query', authLogin, controller.userDevice.query)
  router.get('/userDevice/delete', authLogin, controller.userDevice.delete)
  // 上报信息查询
  router.get('/userMessage/query', authLogin, controller.userMessage.query)
  router.get(
    '/userMessage/queryAll',
    authLogin,
    controller.userMessage.queryAll
  )
  // router.get('/userDevice/delete', controller.userMessage.query)
  router.get('/equipment/queryLocation', controller.trackUpload.query)
  router.post('/track/upload', controller.trackUpload.trackUpload)
}
